import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import * as path from 'path'

export default defineConfig({
  // base:'/static/',
  plugins: [
    vue()
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src') // 使用 path 模块
    }
  },
  server: {
    proxy: {
      // 详细配置写法
      "/api": {
        // target: "http://192.168.1.52:8063/v1",
        target: "http://192.168.1.211:8080/v1",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
    },
  },
});
